import Vue from 'vue'
import Router from 'vue-router'

import Home from './home'
import Me from './me'
import Summarize from './summarize'
import Tool from './tool'
import Set from './set'

Vue.use (Router)

const router = new Router ({
  routes: [
    Home,
    Me,
    Summarize,
    Tool,
    Set,
    {
      path: '*',
      redirect: '/home/root'
    }
  ]
})

router.afterEach (() => {
  // 界面刷新到最顶部
  document.body.scrollTop = 0
  document.documentElement.scrollTop = 0
})

export default router
